package com.mnt.gui.base.buildfactory.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;




/**
 * table element annotation
 * table column builder
 * @author 2014-3-29 mnt.cico
 *
 */
@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface FXTable
{
	/**
	 * support column convert type 
	 * @author 2014-3-29 mnt.cico
	 *
	 */
	public enum ColType {
		TEXT("Text"), BUTTON("Button"), CHOICEBOX("ChoiceBox"), TEXTFIELD("TextField"), CHECKBOX("CheckBox"),DATEPRICKER("DatePricker"); 
		private String name;
		private ColType(String name) {
			this.name = name;
		}
		public String getName(){
			return name;
		}
		
		@Override
		public String toString() {
			return name;
		}
	};
	
	
	/**
	 * convert column field default text
	 * 2014-3-29 mnt.cico
	 */
	public ColType colType() default ColType.TEXT;
	
	/**
	 * bind column field object name
	 * 2014-3-29 mnt.cico
	 */
	public String fieldName() default "";
	
	/**
	 * field class type
	 * 2014-3-29 mnt.cico
	 */
	public Class<?> fieldClass() default String.class;
	
	/**
	 * column corresponding index start with 0 
	 *  2014-3-29 mnt.cico
	 */
	public int colIndex() default -1;
	
	/**
	 * is choice item
	 * 2014-3-29 mnt.cico
	 */
	public boolean isItem() default false;
}
